﻿@model Coevery.Entities.ViewModels.EntityDetailViewModel
<header id="page-title">
    <h1 class="pull-left">Entity Detail <span>show entity detail information</span></h1>
</header>
<section id="main-content" data-ng-init="metaId='@Model.Id';isPublished='@Model.HasPublished'">
    <div id="page-actions" class="clearfix">
        <btn-actions>
            <button type="button" class="btn btn-small" data-ng-click="exit()">Back</button>
            <button type="button" class="btn btn-small" data-ng-click="edit()">
                <i class="icon-edit"></i>&nbsp;Edit
            </button>
            <button class="btn btn-small" data-ng-click="publish()">
                Publish
            </button>
            <button type="button" class="btn btn-small" co-delete-button confirm-message="You really want to delete this entity?" delete-action="delete(@Model.Id)">
                <i class="icon-remove"></i>&nbsp;Delete
            </button>
            <button type="button" data-ng-disabled="isPublished=='False'"
                    class="btn btn-small" data-ng-click="formDesigner()"
                title="@Model.PublishTip">
                Form Designer
            </button>
        </btn-actions>
    </div>

    <div class="row-fluid">
        <div class="span12">
            <div class="row-fluid">
                <section class="span12 view-mode">
                    <header>
                        <h5>General Info</h5>
                    </header>
                    <div class="data-row clearfix">
                        <span class="title control-label">Name</span>
                        <div class="controls">
                            <span class="control-text">@Model.Name</span>
                        </div>
                    </div>
                    <div class="data-row clearfix">
                        <span class="title control-label">Display Name</span>
                        <div class="controls">
                            <span class="control-text">@Model.DisplayName</span>
                        </div>
                    </div>
                </section>
            </div>

            <div class="row-fluid">
                <div class="mytabs">
                    <ul class="nav nav-tabs">
                        <li data-ng-class="{active: showField}">
                            <a data-ng-href="#/Entities/{{$stateParams.Id}}">Fields</a>
                        </li>
                        <li data-ng-class="{active: showRelation}" title="@Model.PublishTip">
                            <a data-ng-href="#/Entities/{{$stateParams.Id}}/Relationships">Relationships</a>
                        </li>
                        <li data-ng-class="{active: showView}" title="@Model.PublishTip">
                            <a data-ng-href="#/Entities/{{$stateParams.Id}}/Views">Views</a>
                        </li>
                    </ul>
                </div>
                <div class="tab-content">
                    <div class="tab-pane active">
                        <div class="ng-cloak" ui-view>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<script type="text/javascript">
    $(function () {
        $("#main-content").css("margin-top", $("#page-title").outerHeight(true));
        $("#page-actions h1 span").attr("title", $("#page-actions h1 span").html());
    });
</script>
